//电子邮件puhalskijsemen@gmail.com
//网站 开vpn打开 http://web3incubators.com/
//电报https://t.me/gamecode999
import { _decorator, Component, Sprite } from 'cc';
import { Global } from '../Global';
import { Tools } from '../utils/Tools';
const { ccclass, property } = _decorator;

@ccclass('LoadCtrl')
export class LoadCtrl extends Component {

    @property(Sprite)
    load: Sprite = null;

    private isload = true;


    closeLoad() {
        this.isload = false;
        Tools.clearUI(this.node);
    }




    update(deltaTime: number) {
        if (!this.isload) return;

        this.load.fillRange = Global.LoadingRate;
        if (Global.LoadingRate >= 0.99) {
            this.closeLoad();
        }

    }
}

